SELECT setval('areas_areaid_seq', (SELECT MAX(areaid) FROM cms_areas)+1);
SELECT setval('contentcategories_categoryid_seq', (SELECT MAX(categoryid) FROM cms_content_categories)+1);
SELECT setval('contentcomments_commentid_seq', (SELECT MAX(commentid) FROM cms_content_comments)+1);
SELECT setval('contentpages_contentpageid_seq', (SELECT MAX(contentpageid) FROM cms_content_pages)+1);
SELECT setval('emailtemplates_emailtemplateid_seq', (SELECT MAX(emailtemplateid) FROM cms_email_templates)+1);
SELECT setval('feedbackitems_feedbackitemid_seq', (SELECT MAX(feedbackitemid) FROM cms_feedback_items)+1);
SELECT setval('log_id_seq', (SELECT MAX(id) FROM cms_log)+1);
SELECT setval('modules_moduleid_seq', (SELECT MAX(moduleid) FROM cms_modules)+1);
SELECT setval('portalresourcetypes_portalresourcetypeid_seq', (SELECT MAX(portalresourcetypeid) FROM cms_portal_resource_types)+1);
SELECT setval('portalresources_portalresourceid_seq', (SELECT MAX(portalresourceid) FROM cms_portal_resources)+1);
SELECT setval('portals_portalid_seq', (SELECT MAX(portalid) FROM cms_portals)+1);
SELECT setval('profiles_profileid_seq', (SELECT MAX(profileid) FROM cms_profiles)+1);
SELECT setval('redirects_redirect301id_seq', (SELECT MAX(redirect301id) FROM cms_redirects)+1);
SELECT setval('searchlog_searchtermid_seq', (SELECT MAX(searchtermid) FROM cms_search_log)+1);
SELECT setval('themes_themeid_seq', (SELECT MAX(themeid) FROM cms_themes)+1);
SELECT setval('widgets_widgetid_seq', (SELECT MAX(widgetid) FROM cms_widgets)+1);
SELECT setval('zones_zoneid_seq', (SELECT MAX(zoneid) FROM cms_zones)+1);
SELECT setval('forum_forums_forumid_seq', (SELECT MAX(forumid) FROM forum_forums)+1);
SELECT setval('forum_posts_postid_seq', (SELECT MAX(postid) FROM forum_posts)+1);
SELECT setval('optin_attachments_attachmentid_seq', (SELECT MAX(attachmentid) FROM optin_attachments)+1);
SELECT setval('optin_linktracking_linktrackingid_seq', (SELECT MAX(linktrackingid) FROM optin_link_tracking)+1);
SELECT setval('optin_lists_listid_seq', (SELECT MAX(listid) FROM optin_lists)+1);
SELECT setval('optin_newsletters_newsletterid_seq', (SELECT MAX(newsletterid) FROM optin_newsletters)+1);
SELECT setval('optin_subscribers_subscriberid_seq', (SELECT MAX(subscriberid) FROM optin_subscribers)+1);
SELECT setval('optin_subscriberslists_subscriberlistid_seq', (SELECT MAX(subscriberlistid) FROM optin_subscribers_lists)+1);
SELECT setval('social_data_socialdataid_seq', (SELECT MAX(socialdataid) FROM social_data)+1);
SELECT setval('social_images_imageid_seq', (SELECT MAX(imageid) FROM social_images)+1);
SELECT setval('social_likes_likeid_seq', (SELECT MAX(likeid) FROM social_likes)+1);
SELECT setval('social_messages_messageid_seq', (SELECT MAX(messageid) FROM social_messages)+1);
SELECT setval('social_messagetypes_messagetypeid_seq', (SELECT MAX(messagetypeid) FROM social_messagetypes)+1);
SELECT setval('store_carts_recordid_seq', (SELECT MAX(recordid) FROM store_carts)+1);
SELECT setval('store_categories_categoryid_seq', (SELECT MAX(categoryid) FROM store_categories)+1);
SELECT setval('store_orderdetails_orderdetailid_seq', (SELECT MAX(orderdetailid) FROM store_order_details)+1);
SELECT setval('store_orders_orderid_seq', (SELECT MAX(orderid) FROM store_orders)+1);
SELECT setval('store_payments_paymentid_seq', (SELECT MAX(paymentid) FROM store_payments)+1);
SELECT setval('store_pricingoptions_priceoptionid_seq', (SELECT MAX(priceoptionid) FROM store_pricing_options)+1);
SELECT setval('store_products_productid_seq', (SELECT MAX(productid) FROM store_products)+1);
SELECT setval('store_pricingoptions_priceoptionid_seq', (SELECT MAX(pricingoptionid) FROM store_products_pricing_options)+1);
SELECT setval('store_shippingmethodrates_shippingrateid_seq', (SELECT MAX(shippingrateid) FROM store_shipping_method_rates)+1);
SELECT setval('store_shippingmethods_shippingmethodid_seq', (SELECT MAX(shippingmethodid) FROM store_shipping_methods)+1);
SELECT setval('tracker_bugattachments_attachmentid_seq', (SELECT MAX(attachmentid) FROM tracker_bug_attachments)+1);
SELECT setval('tracker_bugcomments_commentid_seq', (SELECT MAX(commentid) FROM tracker_bug_comments)+1);
SELECT setval('tracker_bughistory_historyid_seq', (SELECT MAX(historyid) FROM tracker_bug_history)+1);
SELECT setval('tracker_bugnotifications_notificationid_seq', (SELECT MAX(notificationid) FROM tracker_bug_notifications)+1);
SELECT setval('tracker_bugs_bugid_seq', (SELECT MAX(bugid) FROM tracker_bugs)+1);
SELECT setval('tracker_helppages_helppageid_seq', (SELECT MAX(helppageid) FROM tracker_help_pages)+1);
SELECT setval('tracker_projectcategories_categoryid_seq', (SELECT MAX(categoryid) FROM tracker_project_categories)+1);
SELECT setval('tracker_projectcustomfields_customfieldid_seq', (SELECT MAX(customfieldid) FROM tracker_project_customfields)+1);
SELECT setval('tracker_projectmembers_projectmemberid_seq', (SELECT MAX(projectmemberid) FROM tracker_project_members)+1);
SELECT setval('tracker_projectmilestones_milestoneid_seq', (SELECT MAX(milestoneid) FROM tracker_project_milestones)+1);
SELECT setval('tracker_projectnotifications_notificationid_seq', (SELECT MAX(notificationid) FROM tracker_project_notifications)+1);
SELECT setval('tracker_projectpriorities_priorityid_seq', (SELECT MAX(priorityid) FROM tracker_project_priorities)+1);
SELECT setval('tracker_projectstatuses_statusid_seq', (SELECT MAX(statusid) FROM tracker_project_statuses)+1);
SELECT setval('tracker_projects_projectid_seq', (SELECT MAX(projectid) FROM tracker_projects)+1);
SELECT setval('tracker_ticketattachments_attachmentid_seq', (SELECT MAX(attachmentid) FROM tracker_ticket_attachments)+1);
SELECT setval('tracker_ticketcomments_commentid_seq', (SELECT MAX(commentid) FROM tracker_ticket_comments)+1);
SELECT setval('tracker_tickethistory_historyid_seq', (SELECT MAX(historyid) FROM tracker_ticket_history)+1);
SELECT setval('tracker_ticketnotifications_notificationid_seq', (SELECT MAX(notificationid) FROM tracker_ticket_notifications)+1);
SELECT setval('tracker_tickets_ticketid_seq', (SELECT MAX(ticketid) FROM tracker_tickets)+1);
SELECT setval('weightedcontent_weightedcontentid_seq', (SELECT MAX(weightedcontentid) FROM weighted_content)+1);
SELECT setval('weightedcontentmodules_weightedcontentmoduleid_seq', (SELECT MAX(weightedcontentmoduleid) FROM weighted_content_modules)+1);
SELECT setval('weightedcontentwidgets_weightedcontentwidgetid_seq', (SELECT MAX(weightedcontentwidgetid) FROM weighted_content_widgets)+1);
SELECT setval('wiki_contents_contentid_seq', (SELECT MAX(contentid) FROM wiki_contents)+1);
SELECT setval('wiki_settings_wikisettingid_seq', (SELECT MAX(wikisettingid) FROM wiki_settings)+1);
SELECT setval('wiki_titles_titleid_seq', (SELECT MAX(titleid) FROM wiki_titles)+1);
